export function getSrc(phonics) {
    return process.env.PUBLIC_URL + `/media/${phonics
        .replace('ü', 'v')
        .replace(/^ch$/, 'chi')
        .replace(/^yi$/, 'i')
        .replace('wu', 'w')
    }.mp3`;
}

export function splitPhonics(wholePhonics) {
    const patt = new RegExp("(yue|yuan|ang|eng|ying|yin|ing|ong|zh|ch|sh|ri|zi|ci|si|wu|ye|ai|ei|ui|ao|ou|iu|ie|ue|ve|er|an|en|in|un|vn|yi|yu|[a-z])","g");
    let result;
    const splitResult = [];
    while ((result = patt.exec(wholePhonics)) != null)  {
        splitResult.push(result[0]);
    }

    console.log(wholePhonics, splitResult);
    return splitResult;
}
